using System;
using System.ComponentModel.DataAnnotations;

namespace CR.Application.DTOs
{
    /// <summary>
    /// 用户数据传输对象
    /// </summary>
    public class UserDTO
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        [StringLength(50, ErrorMessage = "用户名长度不能超过50个字符")]
        public string Username { get; set; }

        /// <summary>
        /// 密码哈希（不会返回给客户端）
        /// </summary>
        public string PasswordHash { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [StringLength(50, ErrorMessage = "真实姓名长度不能超过50个字符")]
        public string RealName { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [StringLength(100, ErrorMessage = "电子邮箱长度不能超过100个字符")]
        [EmailAddress(ErrorMessage = "电子邮箱格式不正确")]
        public string Email { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [StringLength(20, ErrorMessage = "手机号码长度不能超过20个字符")]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [StringLength(20, ErrorMessage = "角色长度不能超过20个字符")]
        public string Role { get; set; } = "User";

        /// <summary>
        /// 是否锁定
        /// </summary>
        public bool IsLocked { get; set; }

        /// <summary>
        /// 锁定结束时间
        /// </summary>
        public DateTime? LockoutEnd { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 是否激活
        /// </summary>
        public bool IsActive { get; set; }
    }
} 